using CodeSnippet.Formats.Base;

namespace CodeSnippet.Formats
{
    /// <summary>
    /// Provides a base class for formatting languages similar to C.
    /// </summary>
    public abstract class CLikeFormat : CodeFormat
    {
        #region Properties
        /// <summary>
        /// Regular expression string to match single line and multi-line 
        /// comments (// and /* */). 
        /// </summary>
        protected override string CommentRegex
        {
            get { return @"/\*.*?\*/|//.*?(?=\r|\n)"; }
        }
        /// <summary>
        /// Regular expression string to match string and character literals. 
        /// </summary>
        protected override string StringRegex
        {
            get { return @"@?""""|@?"".*?(?!\\).""|''|'.*?(?!\\).'"; }
        }
        #endregion Properties
    }
}